<%@ page import="dao.IAdminDao" %>
<%@ page import="Impl.AdminDaoImpl" %>
<%@ page import="entity.AdminMan" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/4/1
  Time: 16:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
   String name= request.getParameter("loginId");
   String pwd= request.getParameter("password");

    IAdminDao ida=new AdminDaoImpl();

      AdminMan am=ida.login(name,pwd);

   if(am!=null){
       if(am.getAdminDel()==1){
           session.setAttribute("am",am);
           request.getRequestDispatcher("mainform.html").forward(request,response);
       }else {
           response.sendRedirect("index.html");
       }

   }else{
       response.sendRedirect("index.html");
   }



%>
</body>
</html>
